/* isZero.asm
 * Tests whether its argument is number 0
 *
 */

 IS_ZERO_SCHEME:
  PUSH(FP);
  MOV(FP, SP);

  MOV(R0, FPARG(2));
  CALL(IS_NUM);
  CMP(R0,IMM(3));
  JUMP_EQ(L_IS_ZERO_SCHEME_IS_NUM);
  JUMP(L_IS_ZERO_SCHEME_END);				// if argument is not even a number - return false
  
 L_IS_ZERO_SCHEME_IS_NUM:
  MOV(R0,FPARG(2));
  CMP(INDD(R0,1),IMM(0));
  JUMP_EQ(L_IS_ZERO_SCHEME_T);
  MOV(R0, IMM(3));
  JUMP(L_IS_ZERO_SCHEME_END);				// if argument is not 0 - return false
  
 L_IS_ZERO_SCHEME_T:
  MOV(R0, IMM(5));
 
 L_IS_ZERO_SCHEME_END: 
  POP(FP);
  RETURN;